<ion-view id="fundsquest" view-title="请款" cache-view="false" align-title="center" hide-tabs>
    <!-- 申请额度-页眉 -->
    <div class="bar bar-header assertive-bg">
        <a class="button icon-left ion-ios-arrow-back button-clear button-light "></a>

        <h1 class="title light">请款</h1>
    </div>

    <ion-nav-buttons side="right" style="font-size: 30px">
        <button class="button "
                style="color:#ffffff;font-size: 16px;background-color: #CD0A1B;border: none;"
                ng-click="openModal()">
               申请&nbsp;&nbsp;
            <i class="ion-ios-compose-outline" style="font-size: 20px"> </i>
        </button>

    </ion-nav-buttons>
    <!-- 请款-内容 -->
    <ion-content class=" has-header scroll-content">
        <div>
            <div class="item-top">
                <div class="item">
                    <table class="table" style="table-layout:fixed;word-wrap:break-word;" width="100%">
                        <tr style="display: none">
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td align="center" colspan="10" class="title"><h2>额度总览</h2></td>
                        </tr>
                        <tr>
                            <td colspan="2"><span>总额度</span></td>
                            <td colspan="8"><span class="num">{{  fundsquest.AmountLimit }}</span></td>
                        </tr>
                        <tr>
                            <td colspan="2"><span>已&nbsp;&nbsp;&nbsp;用</span></td>
                            <td colspan="8"><span class="num">{{ fundsquest.usedmoney }}</span></td>
                        </tr>
                    </table>
                </div>
            </div>

            <div class="item-bottom">
                <div class="item">
                    <div class="title"><h2>任务详情</h2></div>
                    <table class="table" width="100%" ng-repeat="item in fundsquest.projectlimit">
                        <tr style="display: none">
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                            <td>&nbsp;</td>
                        </tr>
                        <tr>
                            <td class="subtitle" colspan="10"><span class="text">{{ item.projectName }}</span></td>
                        </tr>
                        <tr>
                            <td colspan="2"><span>额&nbsp;&nbsp;&nbsp;度</span></td>
                            <td colspan="8"><span class="num">{{  item.limitAmount }}</span></td>
                        </tr>
                        <tr>
                            <td colspan="2"><span>已&nbsp;&nbsp;&nbsp;用</span></td>
                            <td colspan="8"><span class="num">{{ item.backup1 }}</span></td>
                        </tr>
                    </table>
                </div>
            </div>
    </ion-content>


    <!-- 申请额度模版-->
    <script id="templates/sumrequest.html" type="text/ng-template">
        <ion-modal-view>
            <ion-header-bar class="bar bar-header bar-positive">
                <h1 class="title">申请额度</h1>
                <button class="button button-clear button-primary" ng-click="modal.hide()">取消</button>
            </ion-header-bar>
            <ion-content class="padding has-header scroll-content">

                <div class="list list-inset">


                    <label class="item item-input item-select">
                        <div class="input-label"> 任务选择</div>
                        <select  ng-change="selectChange(mycity)" ng-model="mycity"
                                 ng-options="item.projectId as item.projectName for item in projectlimits">
                            <option value="" selected >-- 请选择 --</option>
                        </select>
                    </label>

                    <!--ProjectLimit.limitAmount总额度-->
                    <!--ProjectLimit.backup1已使用金额-->


                        <label class="item item-input">
                             <span class="input-label">任务额度</span>
                              <span>{{ limitAmount }}</span>
                        </label>
                        <label class="item item-input">
                            <span class="input-label">已用金额</span>
                            <span>{{ backup1 }}</span>
                        </label>
                        <label class="item item-input">
                            <span class="input-label">可用额度</span>
                            <span>{{(limitAmount*1000-backup1*1000 )/1000}}</span>

                        </label>
                        <label class="item item-input">
                            <span class="input-label">已报销金额</span>
                            <input type="number" class="task-input">
                        </label>


                    <label class="item item-input">
                        <span class="input-label">申请额度</span>
                        <input type="number" class="task-input" placeholder="请输入申请额度">
                    </label>
                </div>
                <!-- 申请事由 -->
                <div class="list list-inset">
                    <label class="item ">
                        <span class="input-label">申请事由</span>
                        <textarea rows="4"></textarea>
                    </label>
                </div>
                <!-- 提交 -->
                <div class="list list-inset" ng-click="createContact()">
                    <button class="button button-assertive button-block">
                        提交
                    </button>
                </div>


            </ion-content>
        </ion-modal-view>


    </script>

</ion-view>

